--- id: TASK-044 title: Grammar suggestions & ignore via Harper codeAction status: "\U0001F3C1 Done" assignee: [] created_date: '2026-07-14 15:48' updated_date: '2026-07-14 19:29' labels: - feature dependencies: [] priority: medium ordinal: 43000 --- ## Description Wire Harper's fixes/ignore into the Alt+; popup. Currently glint only renders green grammar underlines (TASK-043). Harper advertises codeActionProvider + executeCommand commands (HarperIgnoreLint, HarperAddToUserDict, HarperAddToFileDict, HarperAddToWSDict). Add: on a grammar span at cursor/click, send textDocument/codeAction for the diagnostic range -> show returned fixes as replacement rows in the proofing popup (reuse spellOption/applySpell plumbing); Ignore -> executeCommand HarperIgnoreLint; Add to dict -> HarperAddToUserDict. Needs: LSP client request/response correlation (id->reply channel; the current client only fires notifications + answers server requests), codeAction result parsing (WorkspaceEdit / Command), and mapping the grammar Diag back to harper's diagnostic (code+range). Store the raw LSP diagnostics (code, range, data) alongside the rune-mapped Diag so codeAction can reference them. ## Acceptance Criteria - [x] #1 Grammar span at cursor offers Harper's fix suggestions in the Alt+; popup - [x] #2 Selecting a fix applies harper's replacement to the buffer - [x] #3 Ignore removes the grammar underline for the session (glint-side; HarperIgnoreLint is a no-op over LSP) ## Implementation Notes Implemented via generic relay of harper codeAction results. Live-probed harper-ls 2.6: replacement quickfixes work great; HarperIgnoreLint is a no-op over LSP and harper offers no add-to-dict for grammar lints. So: (1)(2) replacement fixes wired into the Alt+; popup (grammar package request/response correlation + CodeActions mapping UTF-16 edits to rune coords; app applyGrammarFix applies edits last-first); (3) Ignore is glint-side session ignore keyed by rule+text, mirroring spell IgnoreWord (resets next launch); (4) add-to-dict dropped — not offered by harper for grammar. Bonus: fixed workspace/configuration reply to wrap under {"harper-ls":{}} (was triggering harper's 'Settings must contain a harper-ls key' error). Spec: docs/superpowers/specs/2026-07-14-harper-grammar-actions-design.md